package com.work.lxykeeper.httpretrofit;

import com.google.gson.annotations.SerializedName;

/**
 * author: Wangzhan
 * date :2018/9/28 16:26
 * version:1.0
 * description:
 */

//HttpStatus.java
public class HttpStatus {
    private static final int HTTP_SUCCESS = 1;
    //    {"status":"200","msg":"非法参数-0","data":""} 或  {"code":"200","msg":"非法参数-0","data":""}
    @SerializedName("status")
    private int status;
    @SerializedName("message")
    private String message;

    public int getStatus() {
        return status;
    }

    public String getMsg() {
        return message;
    }

    /**
     * API是否请求失败
     *
     * @return 失败返回true, 成功返回false
     */
    public boolean isCodeInvalid() {
        return status != HTTP_SUCCESS;
    }
}